<?php

namespace app\common\model;

use think\Model;

class Account extends Model
{
    // 表名
    protected $name = 'account';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';

    // 隐藏字段
    protected $hidden = ['is_delete'];

    // 软删除
    public static function boot()
    {
        parent::boot();
        static::addGlobalScope('not_deleted', function ($query) {
            $query->where('is_delete', 0);
        });
    }
}